﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;

public partial class Agency_BidNoPass : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumAdmin);
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumAttorney);
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumCheckGoods);
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumBidGoods);
        if (HZ.MBSM.BLL.Login.CheckAssert(_AccountType))
        {
           // BidNoPassProjectid = Request.QueryString["ProjectId"];
            if (!IsPostBack)
            {
                System.Data.IDataReader drn;
                Db dbn = new Db();
                string strNp = "select MEMO9 from project_bid where Bidid in (" + SysFun.ToTrim(Request.QueryString["Bidid"]) +")";
                drn = dbn.DataReader(strNp);
                if (drn.Read())
                {
                    TextBox1.Text = SysFun.ToTrim(drn["MEMO9"].ToString());
                }
                drn.Dispose();
                drn.Close();
                dbn.Close();
            }
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
        if ((_Account != null) && (SysFun.ToTrim(TextBox1.Text)!=""))
        {
            Db db = new Db();
            string atname = _Account.AccountName;
            string _strBidid = SysFun.IsSQL(SysFun.ToTrim(Request.QueryString["Bidid"]));
            String strSql = "Update project_bid set MEMO9='" + SysFun.ToTrim(TextBox1.Text) + "',checkstatus=2,memo8='" + atname + "',SHSJ=getdate() where Bidid in (" + _strBidid + ")";
            db.Command(strSql);
            db.Close();
            HZ.MBSM.BLL.LogManage.RecordLoginDetail(_Account.AccountName, Request.UserHostAddress, "更新", "project_bid", strSql, "../Agency/BidNoPass.aspx");
            
            Session["IsCheck"] = 2;
            //Response.Write("<script>window.location='../Agency/Check_BidGood.aspx?projectid=" + BidNoPassProjectid + "';</script>");
            Response.Write("<script>window.opener.location.reload();window.close();</script>");
        }
        else
        {
            Response.Write("<script language=JavaScript>alert('您无权审核商品信息！！！');</script>");
        }
    }
}
